//
//  CollectionViewCell.m
//  BannerViewDemo
//
//  Created by BaizYi on 2018/11/5.
//  Copyright © 2018 BaizYi. All rights reserved.
//

#import "CollectionViewCell.h"

@interface CollectionViewCell ()



@end

@implementation CollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self.contentView addSubview:self.photoView];
    }
    return self;
}

-(void)setImage:(UIImage *)image{
    _image = image;
    self.photoView.image = image;
}

-(UIImageView *)photoView{
    if (_photoView == nil) {
        _photoView = [[UIImageView alloc]initWithFrame:self.contentView.frame];
        _photoView.contentMode = UIViewContentModeScaleToFill;
        _photoView.layer.masksToBounds = YES;
    }
    return _photoView;
}

@end
